package com.ef.service.impl;

import java.util.List;

import com.ef.constant.StatusType;
import com.ef.dao.CorpClassDao;
import com.ef.domain.CorpClass;
import com.ef.domain.CorpContract;
import com.ef.service.CorpClassService;

public class CorpClassServiceImpl extends BaseServiceImpl implements
		CorpClassService {

	private CorpClassDao corpClassDao;

	public List<CorpClass> findByContract(CorpContract contract) {
		return corpClassDao.findByContract(contract);
	}

	public void saveOrUpdate(CorpClass entity) {
		corpClassDao.clear();
		corpClassDao.saveOrUpdate(entity);
	}

	public void delete(CorpClass entity) {
		entity.setStatus(StatusType.INVALID);
		corpClassDao.update(entity);
	}

	public CorpClassDao getCorpClassDao() {
		return corpClassDao;
	}

	public void setCorpClassDao(CorpClassDao corpClassDao) {
		this.corpClassDao = corpClassDao;
	}

}
